# Maintainer: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=cdrdao
pkgver=1.2.4
pkgrel=2
arch=('x86_64')
license=('GPL')
url="http://cdrdao.sourceforge.net/"
pkgdesc='Records audio/data CD-Rs in disk-at-once (DAO) mode'
depends=('gcc-libs' 'lame' 'libmad' 'libvorbis' 'libao')
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2
        cdrdao-1.2.3-autoconf-update.patch
        cdrdao-1.2.3-k3b.patch)
sha256sums=('358d9cb83370ceaecdc60564cbf14c2ea2636eac60a966e2461c011ba09853b4'
            '2f4f54ed23b4f3b22fd64a2a3d4fa67ff186b3865213cba3fbe81ed9f6c42c74'
            '6eddd7c79f548b3ad1d8d4ce23367bcae3cd6dee74f0aeb6439758d6599090e0')

prepare() {
  cd ${pkgname}-${pkgver}
  
  patch -Np1 -i ../cdrdao-1.2.3-autoconf-update.patch
  patch -Np1 -i ../cdrdao-1.2.3-k3b.patch
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr \
	--mandir=/usr/share/man \
	--sysconfdir=/etc \
	--without-xdao --with-lame \
	--with-ogg-support --with-mp3-support
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
